using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

public class Reward : MonoBehaviour
{
    public UnityEvent OnGain;

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("Player"))
        {
            OnGain?.Invoke();
            Destroy(this.gameObject);
        }
    }
}
